package com.deep.schedule;

import com.deep.schedule.entity.Work;
import com.deep.schedule.work.Calculation;
import com.deep.schedule.work.CalculationImpl;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Deep
 * @date 2021/10/5 12:41
 */
public class ScheduleMain {

    public static void main(String[] args) {
        System.out.println("请依次输入进程名、到达时间、运行时间");

        List<Work> workList = new ArrayList<>();
        workList.add(new Work("C", 5, 8));
        workList.add(new Work("D", 5, 15));
        workList.add(new Work("E", 12, 9));
        workList.add(new Work("A", 0, 7));
        workList.add(new Work("B", 2, 4));

        Calculation cal = new CalculationImpl();
        System.out.println("先来先服务算法：");
        cal.fcfs(workList);
        System.out.println("最短作业优先算法：");    // 作业不进行中断
        cal.slf(workList);

    }
}
